package com.jboost.modules.area.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.jboost.common.system.base.entity.JBoostEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
    * 地址
    */
@ApiModel(value="com-jboost-modules-csc-supplier-entity-CscAddress")
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "jboost_address")
public class JboostAddress extends JBoostEntity {

    @TableLogic
    @TableField(value = "del_flag")
    @ApiModelProperty(value="")
    private Integer delFlag;

    @Version
    @TableField(value = "version")
    @ApiModelProperty(value="")
    private Integer version;

    @TableField(value = "province")
    @ApiModelProperty(value="")
    private String province;

    @TableField(value = "city")
    @ApiModelProperty(value="")
    private String city;

    @TableField(value = "county")
    @ApiModelProperty(value="")
    private String county;

    @TableField(value = "address")
    @ApiModelProperty(value="")
    private String address;

    /**
     * 区域地址的 id
     */
    @TableField(value = "area_id")
    @ApiModelProperty(value="区域地址的 id")
    private String areaId;

    // 经度
    @TableField(value = "longitude")
    private BigDecimal longitude;

    // 纬度
    @TableField(value = "latitude")
    private BigDecimal latitude;

    public String getAllAddress(){
        return this.province+this.city+this.county+this.address;
    }

}